Skip to content

Document config-shaping env vars delivered via loadEnv .env files#564

Open
kylebernhardy wants to merge 4 commits into
mainfrom
docs/load-env-config-shaping-1513
Open

Document config-shaping env vars delivered via loadEnv .env files#564
kylebernhardy wants to merge 4 commits into
mainfrom
docs/load-env-config-shaping-1513

Conversation

@kylebernhardy

@kylebernhardy kylebernhardy commented Jul 2, 2026

Copy link
Copy Markdown
Member

Companion docs for HarperFast/harper#1580 (fixes HarperFast/harper#1513) — pivoted with the PR: config-shaping env vars delivered via a component's .env are not honored (config is strictly top-down); what 5.2.0 adds is the loud, actionable warning replacing the old silent no-op. The section documents the behavior, the warning, and the supported channels.

Hold merging until harper#1580 lands.

Generated by an LLM (Claude Fable 5).

Companion to HarperFast/harper#1580 (fixes HarperFast/harper#1513):
HARPER_CONFIG / HARPER_SET_CONFIG / HARPER_DEFAULT_CONFIG delivered via
a component .env are now applied before config composition. Documents
precedence, encrypted-value and componentsRoot limitations.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a new section to the environment variables documentation explaining how config-shaping variables are loaded early from .env files starting in version 5.2.0. The review feedback suggests a minor clarification to specify that the override: true property belongs to the loadEnv configuration rather than a generic component.

Comment thread reference/environment-variables/overview.md Outdated
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions
github-actions Bot temporarily deployed to pr-564 July 2, 2026 20:08 Inactive
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

🚀 Preview Deployment

Your preview deployment is ready!

🔗 Preview URL: https://preview.harper-documentation.harperfabric.com/pr-564

This preview will update automatically when you push new commits.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions
github-actions Bot temporarily deployed to pr-564 July 8, 2026 21:13 Inactive
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

🚀 Preview Deployment

Your preview deployment is ready!

🔗 Preview URL: https://preview.harper-documentation.harperfabric.com/pr-564

This preview will update automatically when you push new commits.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@kylebernhardy

Copy link
Copy Markdown
Member Author

harper#1580 has merged to main and is cherry-picked to v5.1 (harper#1754, patch label) — hold released, version text updated to mention 5.1.18+. Ready for review. Comment generated by an LLM (Claude Fable 5).

@github-actions

Copy link
Copy Markdown

🚀 Preview Deployment

Your preview deployment is ready!

🔗 Preview URL: https://preview.harper-documentation.harperfabric.com/pr-564

This preview will update automatically when you push new commits.

@kylebernhardy
kylebernhardy marked this pull request as ready for review July 22, 2026 04:07
@kylebernhardy
kylebernhardy requested a review from a team as a code owner July 22, 2026 04:07

@kriszyp kriszyp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you are filing a duplicate PR?


Files are loaded in the order specified.

## Config-Shaping Variables Are Not Honored

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This guidance is now already present on origin/main in the loadEnv warning added by #579 (current main lines 49-57). A three-way merge keeps both insertions, so the page would explain the same rule and workaround twice. Could we rebase and fold only the uniquely useful warning-timing detail into the existing warning, or close this PR as superseded?


The three configuration env vars — `HARPER_DEFAULT_CONFIG`, `HARPER_CONFIG`, and `HARPER_SET_CONFIG` (see [Configuration](../configuration/overview.md)) — shape Harper's root configuration, which is composed once at startup, **before components load**. Delivering one of them through a `loadEnv` `.env` file therefore has **no effect**: configuration is strictly top-down (the instance's configuration controls components, never the reverse), so a component cannot shape instance-wide config.

As of 5.2.0 (and 5.1.x patch releases from 5.1.18) this is no longer silent: Harper logs a prominent warning at startup for each config-shaping variable found in a component `.env` file — naming the variable and the file — and again at component load time (which also covers components deployed after startup). Earlier versions ignored these variables without any message.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The v5.1 backport first shipped in v5.1.19, not v5.1.18: merge 2fff82731 is not contained by the v5.1.18 tag, while it is contained by v5.1.19 (componentEnvPrepass.ts is likewise absent in 5.1.18 and present in 5.1.19). Please change this to from 5.1.19 so 5.1.18 operators are not told to expect warnings their version cannot emit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP application config from loadEnv (.env) not applied — config composed/memoized before components run

3 participants